﻿@model Zor_Web.Models.Stat.V_LeaseTaxStat
@using Webdiyer.WebControls.Mvc;
@using Zor_Tools;
@{
    Layout = null;
}
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>出租税收统计</title>
    <link href="~/Content/LayerUI/src/css/layui.css" rel="stylesheet" />
    <link href="~/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/Styles/zor.css" rel="stylesheet" />
    <!-- 框架必要 -->
    <script src="~/Content/Scripts/jquery/jquery-1.9.1.min.js"></script>
    <script src="~/Content/Scripts/learunui-framework.js"></script>
    <script src="~/Content/Scripts/Zor_AJax.js"></script>
    <!-- 消息提示 -->
    <script language='javascript' src='~/Content/layer/layer.js'></script>
    <!--Echerts -->
    <script src="~/Content/Scripts/Echart/echarts.min.js"></script>
</head>
<body>
    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="HrCharts"></div>
</body>
</html>
<script>

    //已收税户数
    var TaxHouseholds;
    getAjax("/Stat/TaxHouseholds", "", function (data) {
        TaxHouseholds = eval(data);
    })

    //已收税月份
    var months;
    getAjax("/Stat/months", "", function (data) {
        months = eval(data);
    })
    //已租户数
    var LeaseHouseholds;
    getAjax("/Stat/LeaseHouseholds", "", function (data) {
        LeaseHouseholds = eval(data);
    })
    //已租月份
    var L_month;
    getAjax("/Stat/L_month", "", function (data) {
        L_month = eval(data);
    })

    // 基于准备好的dom，初始化echarts实例
    var myChart = document.getElementById('HrCharts');

    var myChartContainer = function () {
        myChart.style.width = (window.innerWidth - 50) + 'px';
        myChart.style.height = (window.innerHeight) + 'px';
    };
    myChartContainer();
    var eChart = echarts.init(myChart);
    // 指定图表的配置项和数据

    option = {
        title: {
            text: '房屋出租数-税收数总览图',
            subtext: ''
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data: ['蒸发量', '降水量']
        },
        toolbox: {
            show: true,
            feature: {
                dataView: { show: true, readOnly: false },
                magicType: { show: true, type: ['line', 'bar'] },
                restore: { show: true },
                saveAsImage: { show: true }
            }
        },
        calculable: true,
        xAxis: [
            {
                type: 'category',
                data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
            }
        ],
        yAxis: [
            {
                type: 'value'
            }
        ],
        series: [
            {
                name: '蒸发量',
                type: 'bar',
                data: [2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
                markPoint: {
                    data: [
                        { type: 'max', name: '最大值' },
                        { type: 'min', name: '最小值' }
                    ]
                },
                markLine: {
                    data: [
                        { type: 'average', name: '平均值' }
                    ]
                }
            },
            {
                name: '降水量',
                type: 'bar',
                data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
                markPoint: {
                    data: [
                        { name: '年最高', value: 182.2, xAxis: 7, yAxis: 183 },
                        { name: '年最低', value: 2.3, xAxis: 11, yAxis: 3 }
                    ]
                },
                markLine: {
                    data: [
                        { type: 'average', name: '平均值' }
                    ]
                }
            }
        ]
    };









   /*
    option = {
        title: {
            text: '房屋出租数-税收数总览图',
            subtext: '年度总览'

        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data: ['已租户数', '已收税户数']
        },
        toolbox: {
            show: true,
            feature: {
                dataZoom: {
                    yAxisIndex: 'none'
                },
                dataView: { show: true, readOnly: false },
                magicType: { show: true, type: ['line', 'bar'] },
                restore: { show: true },
                saveAsImage: { show: true }
            }
        },
        calculable: true,
        xAxis: [
            {
                type: 'category',
                data: L_month 
            }
    

        ],

        yAxis: {
            type: 'value',
            axisLabel: {
                formatter: '{value} 户'
            }
        },
        series: [
            {
                name: '已租户数',
                type: 'bar',
                data: LeaseHouseholds,
                markLine: {
                    data: [
                        { type: 'average', name: '平均值' },
                        [{
                            symbol: 'none',
                            x: '90%',
                            yAxis: 'max'
                        }, {
                            symbol: 'circle',
                            label: {
                                normal: {
                                    position: 'start',
                                    formatter: '已租户数最大值'
                                }
                            },
                            type: 'max',
                            name: '最高点'
                        }]
                    ]
                }

            },
            {
                name: '已收税户数',
                type: 'bar',
                data: TaxHouseholds,
                markLine: {
                    data: [
                        { type: 'average', name: '平均值' },
                        [{
                            symbol: 'none',
                            x: '90%',
                            yAxis: 'max'
                        }, {
                            symbol: 'circle',
                            label: {
                                normal: {
                                    position: 'start',
                                    formatter: '已收税户数最大值'
                                }
                            },
                            type: 'max',
                            name: '最高点'
                        }]
                    ]
                }

            }
        ]
    };

    */

    // 使用刚指定的配置项和数据显示图表。
    eChart.setOption(option);
    //浏览器大小改变时重置大小
    window.onresize = function () {
        myChartContainer();
        eChart.resize();
    };
</script>

